package ControlLayer;
import java.util.ArrayList;
import ModelLayer.*;
//model layer package has to be imported
/**
 * Controller class for the DVD collection
 * 
 * @author (kbh) 
 * @version (2005.03.31)
 * @revised version English (Ab)
 */
public class DVDCtr
{
    private DvdContainer dvdList;

    /**
     * Constructor for objects of class DVDCtr
     */
    public DVDCtr()
    {
        dvdList = DvdContainer.getInstance();
    }
    
    public void getDVD(long id)
    {
        dvdList.getDvd(id); 
    }
    
    //Creates a new Dvd and adds it to the dvdList
    public void createDVD(long id, String title, String author, String releaseDate)
    {       
          //this method constructs a new dvd object 
          //and stores it in the container
          Dvd newDvd = new Dvd(id, title, author, releaseDate);     
          
          //Sample newSample = new Sample(serialNo, acqDate, acqPrice);
          dvdList.addDvd(newDvd);
          //sampleList.addSample(newSample);
          
    }
    
    public void updateDvd(long id, String title, String author, String releaseDate)
    {
        dvdList.updateDvd(id, title, author, releaseDate);
    }
    
    public void deleteDVD(long id)
    {
        
        //search for the dvd and delete the object from the container
        dvdList.deleteDvd(id);
    }
    
    public void createSample(long id, long serialNo, String acqDate, double acqPrice)
    {
        dvdList.addSample(id, serialNo, acqDate, acqPrice);
    }
    
     public void getSample(long id, long serialNo)
    {
        dvdList.getSample(id, serialNo);
    }
    
    public void deleteSample(long id, long serialNo)
    {
        dvdList.deleteSample(id, serialNo);
    }
    
    public void updateSample(long id, long serialNo, String acqDate, double acqPrice)
    {
        dvdList.updateSample(id, serialNo, acqDate, acqPrice);
    }
    
    public void listAllDvds()
    {
          dvdList.showDvds();
          
    }
}